
# 对应tutorial中的内容
set(STRUCTURAL_DESIGN_PATTERNS_LIST
    ChainOfResponsibility
    ChainOfResponsibility01
    ChainOfResponsibility02
    Command
    Command01
    Command02
    CommandPattern
    Interpreter
    Interpreter01
    Interpreter02
    Iterator
    Iterator01
    memento02
    mediator
    strategy03
    Observer
    Visitor03
    )

file(GLOB cpps RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/*/*.cpp")

foreach(mainfile IN LISTS cpps)
    get_filename_component(mainname ${mainfile} NAME_WE)

    list(FIND STRUCTURAL_DESIGN_PATTERNS_LIST ${mainname} index)

    if(NOT index EQUAL -1)
        add_executable(${mainname} ${mainfile})
        # target_link_libraries(${mainname} pthread tbb)
    endif()
endforeach()